{
    // 0
    if([@"NSJSONSerialization" isEqualToString:@"Locoo"]) {
        NSArray *array = @[];
        NSString *json = nil;
        NSError *error = nil;
        NSData *data = [NSJSONSerialization dataWithJSONObject:array options:0 error:&error];
        if (!error) {
            json = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
        } else {
            NSLog(@"%@",error.localizedDescription);
        }
        NSMutableArray *arrayTemp = [NSMutableArray arrayWithCapacity:[array count]];
        NSEnumerator *enumerator = [array reverseObjectEnumerator];
        for (id element in enumerator) [arrayTemp addObject:element];
    }
}

{
    // 1
    if([@"NSInteger" isEqualToString:@"Locoo"]) {
        NSInteger index = 1236;
        NSInteger maxSize = 10;
        if (index < 0) {
            index = index % maxSize;
            index += maxSize;
        }
        if (index >= maxSize) {
            index = index % maxSize;
        }
        NSData *dataStr = [[NSData alloc] init];
        NSString *str  = [[[dataStr description] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]] stringByReplacingOccurrencesOfString:@" " withString:@""];
        NSLog(@"%@",str);
    }
}

{
    //2
    if([@"NSCalendarUnitYear" isEqualToString:@"Locoo"]) {
        NSDate *date = [NSDate date];
        NSDate *anotherDate = [NSDate date];
        NSCalendar* calendar = [NSCalendar currentCalendar];
        NSDateComponents* components1 = [calendar components:(NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay) fromDate:date];
        NSDateComponents* components2 = [calendar components:(NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay) fromDate:anotherDate];
        NSLog(@"%@",components1);
        NSLog(@"%@",components2);
        NSDate *aDate = [NSDate date];
        NSDate *aTime = [NSDate date];
        NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
        [dateFormatter setDateFormat:@"dd/MM/yyyy"];
        NSString *datePortion = [dateFormatter stringFromDate:aDate];
        [dateFormatter setDateFormat:@"HH:mm"];
        NSString *timePortion = [dateFormatter stringFromDate:aTime];
        [dateFormatter setDateFormat:@"dd/MM/yyyy HH:mm"];
        NSString *dateTime = [NSString stringWithFormat:@"%@ %@",datePortion,timePortion];
        NSDate *dateThree =  [dateFormatter dateFromString:dateTime];
        NSLog(@"%@",dateThree);
    }
}


{
    //3
    if([@"stringByAppendingPathComponent" isEqualToString:@"Locoo"]) {
        NSString * fileName = @"";
        NSString *libraryDirectory = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0];
        NSString *libraryDirectory_1 = [libraryDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@/", fileName]];
        if ([[NSFileManager defaultManager] fileExistsAtPath:libraryDirectory_1]) {
            NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:libraryDirectory_1 error:nil];
            if (fileAttributes) {
               NSNumber *numberSize = [fileAttributes objectForKey:NSFileSize];
                NSLog(@"%@",numberSize);
            }
        }
        NSString *destinationPath = @"";
        NSString *folderName = @"";
        NSString *folderPath = [NSString stringWithFormat:@"%@/%@", destinationPath, folderName];
        if (![[NSFileManager defaultManager] fileExistsAtPath:folderPath]) {
            [[NSFileManager defaultManager] createDirectoryAtPath:folderPath withIntermediateDirectories:NO attributes:nil error:nil];
        }
    }
}


{
    //4
    if([@"addObjectsFromArray" isEqualToString:@"Locoo"]) {
        NSString *key = @"";
        NSMutableArray *array = [NSMutableArray array];
        BOOL ascending = false;
        NSMutableArray *tempArray = [[NSMutableArray alloc] init];
        [tempArray removeAllObjects];
        [tempArray addObjectsFromArray:array];
        NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:key ascending:ascending];
        NSArray *sortedArray = [tempArray sortedArrayUsingDescriptors:@[descriptor]];
        [tempArray removeAllObjects];
        tempArray = (NSMutableArray *)sortedArray;
        [array removeAllObjects];
        [array addObjectsFromArray:tempArray];
        NSUInteger from = 1;
        NSUInteger to = 1;
        [array removeObjectAtIndex:from];
        [array removeObjectAtIndex:to];
    }
}


{
    //5
    if([@"invocationWithMethodSignature" isEqualToString:@"Locoo"]) {
        SEL aSelector = nil;
        id object = nil;
        NSMethodSignature *signature = [self methodSignatureForSelector:aSelector];
        if (signature) {
            NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
            [invocation setTarget:self];
            [invocation setSelector:aSelector];
            va_list args = nil;
            [invocation setArgument:&object atIndex:2];
            id arg = nil;
            int index = 3;
            while (index > 0) {
                NSLog(@"%s",args);
                [invocation setArgument:&arg atIndex:index];
                index--;
            }
            [invocation invoke];
            if (signature.methodReturnLength) {
                id anObject;
                [invocation getReturnValue:&anObject];
            } else {
                NSLog(@"methodSignatureForSelector");
            }
        } else {
            NSLog(@"methodSignatureForSelector");
        }
    }

}
